package Train
{
	public class TrainFactory
	{
		public static function createTrain(type:int) : BaseTrain
		{
			var train:BaseTrain = null;
			
			switch( type )
			{
				case BaseTrain.PASSENGER_TRAIN:
					train = new PassengerTrain();
					break;
				
				case BaseTrain.CARGO_TRAIN:
					train = new CargoTrain();
					break;
			}
			
			return train;
		}
	}
}